import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import routes from './router/router.js'
import toast from './util/js/toast.js'
import noStudentToast from './util/js/noStudent.js'
import './vendor/js/fontsize.js'
import './directive/directive.js'
import './vendor/js/getUrlParam.js'
import './vendor/js/jssdk.js'
import './vendor/js/common.js'
import './vendor/css/swiper.min.css'
import './vendor/css/flex.css'
import './vendor/css/main.css'
import VueLazyload from 'vue-lazyload'
import {domain} from './api/api.js'
require('es6-promise').polyfill();
Vue.use(VueLazyload, {
    preLoad: 1.3,
    error: domain+'zxz3.0/assets/loading.png',
    loading:domain+ 'zxz3.0/assets/loading.png',
    attempt: 1
});
Vue.use(VueRouter);
Vue.use(toast);
Vue.use(noStudentToast);
const router = new VueRouter({
    routes
});
router.beforeEach((to, from, next) => {
    if(Vue.prototype.$util&&Vue.prototype.$util.audio){
        Vue.prototype.$util.audio.pause();
    }
    next()
});
new Vue({
    el: '#app',
    components: { App },
    router,
    render:h=>h(App)
});
